<template>
    <div>
        <input type="file" multiple name="toUp" id="toUp"  @change="changeFiles($event)">
        <button type="button" onclick="up()">Upload</button>
    </div>
</template>

<script>
    export default {
        props:['control'],
        data(){
            return{
                files:[]
            }
        },
        created(){
            this.control.activeFileInput=this.activeFileInput;
        },
        name: "FileInput",
        methods: {
            activeFileInput()
            {
                document.querySelector('#toUp').click()
            },
            changeFiles(event) {
                this.files = event.target.files; // (利用console.log输出看file文件对象)
            }
        }
    }
</script>

<style scoped>

</style>